/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
* @description /
* @author pysduck
* @date 2023-12-12
**/
@Data
@TableName("sys_group")
public class Group implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Long id;

    @NotBlank
    @ApiModelProperty(value = "车间")
    private String facility;

    @NotBlank
    @ApiModelProperty(value = "组织")
    private String organization;

    @ApiModelProperty(value = "班组类型")
    private String groupType;

    @NotBlank
    @ApiModelProperty(value = "班组")
    private String teamGroup;

    @NotBlank
    @ApiModelProperty(value = "班组名称")
    private String groupName;

    @ApiModelProperty(value = "配置人数")
    private Integer configuredNumber;

    @ApiModelProperty(value = "默认班次")
    private String defaultShift;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @NotNull
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "车间列表")
    @TableField(exist = false)
    private Facility facilities;

    @ApiModelProperty(value = "班次列表")
    @TableField(exist = false)
    private Shift shifts;

    public void copy(Group source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
